package com.cssy.yd.basic.dao.impl;

import java.util.List;
import org.springframework.dao.DataAccessException;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.cssy.yd.basic.dao.BasicModeDeliveryDAO;
import com.cssy.yd.basic.entity.BasicModeDeliveryDO;
import com.cssy.yd.basic.entity.BasicModePaymentDO;
import com.plat.helper.SearchConditions;

/**
 * ��ݷ��ʶ���ʵ����
 * @since 2013-06-19
 */
public class BasicModeDeliveryDAOImpl extends SqlMapClientDaoSupport implements BasicModeDeliveryDAO {

    /**
     * �������
     * @param basicModeDeliveryDO
     * @return ������ݵ�����
     */
    public String insertBasicModeDeliveryDO(BasicModeDeliveryDO basicModeDeliveryDO) throws DataAccessException {
        Object id = getSqlMapClientTemplate().insert("BasicModeDelivery.insert", basicModeDeliveryDO);
        return (String) id;
    }

    /**
     * ͳ�Ƽ�¼��
     * @param basicModeDeliveryDO
     * @return ����ļ�¼��
     */
    public Integer countBasicModeDeliveryDOByExample(BasicModeDeliveryDO basicModeDeliveryDO) throws DataAccessException {
        Integer count = (Integer) getSqlMapClientTemplate().queryForObject("BasicModeDelivery.countByDOExample", basicModeDeliveryDO);
        return count;
    }

    /**
     * ���¼�¼
     * @param basicModeDeliveryDO
     * @return ��Ӱ�������
     */
    public Integer updateBasicModeDeliveryDO(BasicModeDeliveryDO basicModeDeliveryDO) throws DataAccessException {
        int result = getSqlMapClientTemplate().update("BasicModeDelivery.update", basicModeDeliveryDO);
        return result;
    }

    /**
     * ��ȡ�����б�
     * @param basicModeDeliveryDO
     * @return �����б�
     */
    @SuppressWarnings("unchecked")
    public List<BasicModeDeliveryDO> findListByExample(BasicModeDeliveryDO basicModeDeliveryDO) throws DataAccessException {
        List<BasicModeDeliveryDO> list = getSqlMapClientTemplate().queryForList("BasicModeDelivery.findListByDO", basicModeDeliveryDO);
        return list;
    }

    /**
     * ��������ȡbasicModeDeliveryDO
     * @param id
     * @return basicModeDeliveryDO
     */
    public BasicModeDeliveryDO findBasicModeDeliveryDOByPrimaryKey(String id) throws DataAccessException {
        BasicModeDeliveryDO basicModeDeliveryDO = (BasicModeDeliveryDO) getSqlMapClientTemplate().queryForObject("BasicModeDelivery.findByPrimaryKey", id);
        return basicModeDeliveryDO;
    }

    /**
     * ɾ���¼
     * @param id
     * @return ��Ӱ�������
     */
    public Integer deleteBasicModeDeliveryDOByPrimaryKey(String id) throws DataAccessException {
        Integer rows = (Integer) getSqlMapClientTemplate().delete("BasicModeDelivery_ex.deleteById", id);
        return rows;
    }

	@Override
	public List<BasicModeDeliveryDO> find(SearchConditions scs)
			throws DataAccessException {
		List<BasicModeDeliveryDO> list = getSqlMapClientTemplate().queryForList("BasicModeDelivery_ex.find", scs);
   		return list;
	}

	@Override
	public Integer count(SearchConditions scs) throws DataAccessException {
		// TODO Auto-generated method stub
		Integer count = (Integer) getSqlMapClientTemplate().queryForObject("BasicModeDelivery_ex.count", scs);
   		return count;
	}

}